package controller;

import dao.AdministratorDao;
import model.Administrator;

public class AdministratorController {

    static AdministratorDao administratorDao = new AdministratorDao();

    public static int login(String name, String password) {
        return administratorDao.Login(name, password);
    }

    public int judges(String name) {
        return administratorDao.judges(name);
    }

    public void addUser(Administrator administrator) {
        administratorDao.addAdministrator(administrator);
    }

    public boolean judge(String name, String pass) {
        return !name.isEmpty() && name.length() <= 15 &&
                pass.length() >= 6 && pass.length() <= 15;
    }
}